package com.ysd.lis.controller.sys;


import com.ysd.common.Result;
import com.ysd.common.dto.OrganizationDTO;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.dto.InterfaceDto;
import com.ysd.lis.entity.SysInterface;
import com.ysd.lis.request.InterfaceParam;
import com.ysd.lis.service.SysInterfaceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-04-24
 */
@Api(tags = "接口管理")
@RestController
@RequestMapping("/api/sys/sysInterface")
public class SysInterfaceController extends BaseController {

    @Autowired
    SysInterfaceService sysInterfaceService;

    @ApiOperation("查询")
    @GetMapping("/findSysInterfaceList")
    public Result findSysInterfaceList(InterfaceParam param) {
        return sysInterfaceService.findSysInterfaceList(param);
    }

    @ApiOperation("新增")
    @PostMapping("/addInterface")
    public Result addInterface(@RequestBody SysInterface sysInterface) {
        return sysInterfaceService.addInterface(sysInterface);
    }

    @ApiOperation("修改")
    @PostMapping("/editInterface")
    public Result editInterface(@RequestBody SysInterface sysInterface) {
        return sysInterfaceService.editInterface(sysInterface);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deleteInterface")
    public Result deleteInterface(@RequestBody SysInterface sysInterface) {
        return sysInterfaceService.deleteInterface(sysInterface);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteInterfaceList")
    public Result batchDeleteInterfaceList(@RequestBody InterfaceDto dto) {
        return sysInterfaceService.batchDeleteInterfaceList(dto);
    }

    @ApiOperation("复制组织机构内的数据到另一个组织机构")
    @PostMapping("/copyPasteInterfaceData")
    public Boolean copyPasteInterfaceData(@RequestBody OrganizationDTO input) {
        return sysInterfaceService.copyPasteInterfaceData(input);
    }
}
